﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Oblig3XNA
{
    class Circle
    {
        private VertexPositionColor[] circle;
        private int count = 2000;

        public Circle(float _radius)
        {
            circle = new VertexPositionColor[count];
            circle[0] = new VertexPositionColor(new Vector3(_radius, 0f, 0f), Color.White);
            for (int i = 1; i < count; i++)
            {
                Vector3 point = new Vector3((float)Math.Sin(i)*_radius*_radius, 0f, (float)Math.Cos(i)*_radius*_radius);
                circle[i] = new VertexPositionColor(point,Color.White);
            }
        }

        public void Draw(GraphicsDevice _device)
        {
            _device.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.LineStrip, circle, 0, 500);
        }
    }
}
